package lc01;

import org.junit.jupiter.api.Test;

import java.util.Arrays;

/**
 * @Author Stringzhua
 * @Date 2024/5/28 16:51
 * description:
 */
public class Test03 {
    @Test
    public void Test03() {
        int[] nums = {2, 7, 11, 15};
        int target = 9;
        System.out.println(Arrays.toString(twoSum(nums, target)));
    }

    public int[] twoSum(int[] nums, int target) {
        for (int i = 0; i < nums.length; i++) {
            for (int j = 0; j < nums.length; j++) {
                if (i != j && nums[i] + nums[j] == target) {
                    return new int[]{i, j};
                }
            }
        }
        return null;
    }
}
